<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .spot{
            position:absolute;
            display: inline-block;
            top: 0;
            left: 0;
            width: 10px;
            border-radius: 50%;
            height: 10px;
            background: black;
        }
    </style>
</head>
<body>

</body>
<script>
    function parse(obj) {
        var _obj = obj.split('<');
        var a = {};
        var b = null;
        for (let i = 0; i < _obj.length; i++) {
            if (i === 0){
                a.type = _obj[0];
                a.typeArgs = {};
                b = a.typeArgs;
                console.log(1);
            } else {
                if (i === _obj.length - 1) {
                    b.type = _obj[i].split('>')[0];
                    console.log(3);
                } else {
                    b.type = _obj[i];
                    b.typeArgs = {};
                    b = b.typeArgs;
                    console.log(2);
                }
            }
        }
        console.log(a);
    }
    var m = 'Array<obj<str<bun<int>>>>'
    parse(m)
</script>
</html>